package com.example.demo.dao;

import com.example.demo.entity.SysOrder;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

public interface SysOrderMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order
     *
     * @mbg.generated
     */
    @Delete({
        "delete from sys_order",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order
     *
     * @mbg.generated
     */
    @Insert({
        "insert into sys_order (order_no, order_name, ",
        "pay_price, order_step, ",
        "before_repair_photo, positive_item_photo, ",
        "positive_item_desc, back_item_photo, ",
        "back_item_desc, problem_photo, ",
        "problem_description, customer_id, ",
        "master_id, customer_phone, ",
        "customer_name, customer_signature, ",
        "agree_repair, watch_body_no, ",
        "watch_serial_number, watch_brand_id, ",
        "watch_material, watch_strap_number, ",
        "reservation_date, create_date, ",
        "del_status, archive_status, ",
        "remarks, watch_function, ",
        "watch_movement, case_material, ",
        "watch_exterior, repair_parts, ",
        "purchase_place, tablehandle_button, ",
        "is_insure, entrusted_mail, ",
        "watch_serie, watch_model, ",
        "purchase_time, is_repair, ",
        "customer_profile)",
        "values (#{orderNo,jdbcType=VARCHAR}, #{orderName,jdbcType=VARCHAR}, ",
        "#{payPrice,jdbcType=DECIMAL}, #{orderStep,jdbcType=INTEGER}, ",
        "#{beforeRepairPhoto,jdbcType=VARCHAR}, #{positiveItemPhoto,jdbcType=VARCHAR}, ",
        "#{positiveItemDesc,jdbcType=VARCHAR}, #{backItemPhoto,jdbcType=VARCHAR}, ",
        "#{backItemDesc,jdbcType=VARCHAR}, #{problemPhoto,jdbcType=VARCHAR}, ",
        "#{problemDescription,jdbcType=VARCHAR}, #{customerId,jdbcType=INTEGER}, ",
        "#{masterId,jdbcType=INTEGER}, #{customerPhone,jdbcType=VARCHAR}, ",
        "#{customerName,jdbcType=VARCHAR}, #{customerSignature,jdbcType=VARCHAR}, ",
        "#{agreeRepair,jdbcType=BIT}, #{watchBodyNo,jdbcType=VARCHAR}, ",
        "#{watchSerialNumber,jdbcType=VARCHAR}, #{watchBrandId,jdbcType=INTEGER}, ",
        "#{watchMaterial,jdbcType=VARCHAR}, #{watchStrapNumber,jdbcType=VARCHAR}, ",
        "#{reservationDate,jdbcType=TIMESTAMP}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{delStatus,jdbcType=BIT}, #{archiveStatus,jdbcType=BIT}, ",
        "#{remarks,jdbcType=VARCHAR}, #{watchFunction,jdbcType=INTEGER}, ",
        "#{watchMovement,jdbcType=INTEGER}, #{caseMaterial,jdbcType=INTEGER}, ",
        "#{watchExterior,jdbcType=INTEGER}, #{repairParts,jdbcType=INTEGER}, ",
        "#{purchasePlace,jdbcType=VARCHAR}, #{tablehandleButton,jdbcType=VARCHAR}, ",
        "#{isInsure,jdbcType=BIT}, #{entrustedMail,jdbcType=VARCHAR}, ",
        "#{watchSerie,jdbcType=VARCHAR}, #{watchModel,jdbcType=VARCHAR}, ",
        "#{purchaseTime,jdbcType=TIMESTAMP}, #{isRepair,jdbcType=BIT}, ",
        "#{customerProfile,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(SysOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "id, order_no, order_name, pay_price, order_step, before_repair_photo, positive_item_photo, ",
        "positive_item_desc, back_item_photo, back_item_desc, problem_photo, problem_description, ",
        "customer_id, master_id, customer_phone, customer_name, customer_signature, agree_repair, ",
        "watch_body_no, watch_serial_number, watch_brand_id, watch_material, watch_strap_number, ",
        "reservation_date, create_date, del_status, archive_status, remarks, watch_function, ",
        "watch_movement, case_material, watch_exterior, repair_parts, purchase_place, ",
        "tablehandle_button, is_insure, entrusted_mail, watch_serie, watch_model, purchase_time, ",
        "is_repair, customer_profile",
        "from sys_order",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_name", property="orderName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="order_step", property="orderStep", jdbcType=JdbcType.INTEGER),
        @Result(column="before_repair_photo", property="beforeRepairPhoto", jdbcType=JdbcType.VARCHAR),
        @Result(column="positive_item_photo", property="positiveItemPhoto", jdbcType=JdbcType.VARCHAR),
        @Result(column="positive_item_desc", property="positiveItemDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="back_item_photo", property="backItemPhoto", jdbcType=JdbcType.VARCHAR),
        @Result(column="back_item_desc", property="backItemDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="problem_photo", property="problemPhoto", jdbcType=JdbcType.VARCHAR),
        @Result(column="problem_description", property="problemDescription", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_id", property="customerId", jdbcType=JdbcType.INTEGER),
        @Result(column="master_id", property="masterId", jdbcType=JdbcType.INTEGER),
        @Result(column="customer_phone", property="customerPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_name", property="customerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_signature", property="customerSignature", jdbcType=JdbcType.VARCHAR),
        @Result(column="agree_repair", property="agreeRepair", jdbcType=JdbcType.BIT),
        @Result(column="watch_body_no", property="watchBodyNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_serial_number", property="watchSerialNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_brand_id", property="watchBrandId", jdbcType=JdbcType.INTEGER),
        @Result(column="watch_material", property="watchMaterial", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_strap_number", property="watchStrapNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="reservation_date", property="reservationDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="del_status", property="delStatus", jdbcType=JdbcType.BIT),
        @Result(column="archive_status", property="archiveStatus", jdbcType=JdbcType.BIT),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_function", property="watchFunction", jdbcType=JdbcType.INTEGER),
        @Result(column="watch_movement", property="watchMovement", jdbcType=JdbcType.INTEGER),
        @Result(column="case_material", property="caseMaterial", jdbcType=JdbcType.INTEGER),
        @Result(column="watch_exterior", property="watchExterior", jdbcType=JdbcType.INTEGER),
        @Result(column="repair_parts", property="repairParts", jdbcType=JdbcType.INTEGER),
        @Result(column="purchase_place", property="purchasePlace", jdbcType=JdbcType.VARCHAR),
        @Result(column="tablehandle_button", property="tablehandleButton", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_insure", property="isInsure", jdbcType=JdbcType.BIT),
        @Result(column="entrusted_mail", property="entrustedMail", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_serie", property="watchSerie", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_model", property="watchModel", jdbcType=JdbcType.VARCHAR),
        @Result(column="purchase_time", property="purchaseTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="is_repair", property="isRepair", jdbcType=JdbcType.BIT),
        @Result(column="customer_profile", property="customerProfile", jdbcType=JdbcType.VARCHAR)
    })
    SysOrder selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "id, order_no, order_name, pay_price, order_step, before_repair_photo, positive_item_photo, ",
        "positive_item_desc, back_item_photo, back_item_desc, problem_photo, problem_description, ",
        "customer_id, master_id, customer_phone, customer_name, customer_signature, agree_repair, ",
        "watch_body_no, watch_serial_number, watch_brand_id, watch_material, watch_strap_number, ",
        "reservation_date, create_date, del_status, archive_status, remarks, watch_function, ",
        "watch_movement, case_material, watch_exterior, repair_parts, purchase_place, ",
        "tablehandle_button, is_insure, entrusted_mail, watch_serie, watch_model, purchase_time, ",
        "is_repair, customer_profile",
        "from sys_order"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_name", property="orderName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="order_step", property="orderStep", jdbcType=JdbcType.INTEGER),
        @Result(column="before_repair_photo", property="beforeRepairPhoto", jdbcType=JdbcType.VARCHAR),
        @Result(column="positive_item_photo", property="positiveItemPhoto", jdbcType=JdbcType.VARCHAR),
        @Result(column="positive_item_desc", property="positiveItemDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="back_item_photo", property="backItemPhoto", jdbcType=JdbcType.VARCHAR),
        @Result(column="back_item_desc", property="backItemDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="problem_photo", property="problemPhoto", jdbcType=JdbcType.VARCHAR),
        @Result(column="problem_description", property="problemDescription", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_id", property="customerId", jdbcType=JdbcType.INTEGER),
        @Result(column="master_id", property="masterId", jdbcType=JdbcType.INTEGER),
        @Result(column="customer_phone", property="customerPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_name", property="customerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_signature", property="customerSignature", jdbcType=JdbcType.VARCHAR),
        @Result(column="agree_repair", property="agreeRepair", jdbcType=JdbcType.BIT),
        @Result(column="watch_body_no", property="watchBodyNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_serial_number", property="watchSerialNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_brand_id", property="watchBrandId", jdbcType=JdbcType.INTEGER),
        @Result(column="watch_material", property="watchMaterial", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_strap_number", property="watchStrapNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="reservation_date", property="reservationDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="del_status", property="delStatus", jdbcType=JdbcType.BIT),
        @Result(column="archive_status", property="archiveStatus", jdbcType=JdbcType.BIT),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_function", property="watchFunction", jdbcType=JdbcType.INTEGER),
        @Result(column="watch_movement", property="watchMovement", jdbcType=JdbcType.INTEGER),
        @Result(column="case_material", property="caseMaterial", jdbcType=JdbcType.INTEGER),
        @Result(column="watch_exterior", property="watchExterior", jdbcType=JdbcType.INTEGER),
        @Result(column="repair_parts", property="repairParts", jdbcType=JdbcType.INTEGER),
        @Result(column="purchase_place", property="purchasePlace", jdbcType=JdbcType.VARCHAR),
        @Result(column="tablehandle_button", property="tablehandleButton", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_insure", property="isInsure", jdbcType=JdbcType.BIT),
        @Result(column="entrusted_mail", property="entrustedMail", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_serie", property="watchSerie", jdbcType=JdbcType.VARCHAR),
        @Result(column="watch_model", property="watchModel", jdbcType=JdbcType.VARCHAR),
        @Result(column="purchase_time", property="purchaseTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="is_repair", property="isRepair", jdbcType=JdbcType.BIT),
        @Result(column="customer_profile", property="customerProfile", jdbcType=JdbcType.VARCHAR)
    })
    List<SysOrder> selectAll();

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order
     *
     * @mbg.generated
     */
    @Update({
        "update sys_order",
        "set order_no = #{orderNo,jdbcType=VARCHAR},",
          "order_name = #{orderName,jdbcType=VARCHAR},",
          "pay_price = #{payPrice,jdbcType=DECIMAL},",
          "order_step = #{orderStep,jdbcType=INTEGER},",
          "before_repair_photo = #{beforeRepairPhoto,jdbcType=VARCHAR},",
          "positive_item_photo = #{positiveItemPhoto,jdbcType=VARCHAR},",
          "positive_item_desc = #{positiveItemDesc,jdbcType=VARCHAR},",
          "back_item_photo = #{backItemPhoto,jdbcType=VARCHAR},",
          "back_item_desc = #{backItemDesc,jdbcType=VARCHAR},",
          "problem_photo = #{problemPhoto,jdbcType=VARCHAR},",
          "problem_description = #{problemDescription,jdbcType=VARCHAR},",
          "customer_id = #{customerId,jdbcType=INTEGER},",
          "master_id = #{masterId,jdbcType=INTEGER},",
          "customer_phone = #{customerPhone,jdbcType=VARCHAR},",
          "customer_name = #{customerName,jdbcType=VARCHAR},",
          "customer_signature = #{customerSignature,jdbcType=VARCHAR},",
          "agree_repair = #{agreeRepair,jdbcType=BIT},",
          "watch_body_no = #{watchBodyNo,jdbcType=VARCHAR},",
          "watch_serial_number = #{watchSerialNumber,jdbcType=VARCHAR},",
          "watch_brand_id = #{watchBrandId,jdbcType=INTEGER},",
          "watch_material = #{watchMaterial,jdbcType=VARCHAR},",
          "watch_strap_number = #{watchStrapNumber,jdbcType=VARCHAR},",
          "reservation_date = #{reservationDate,jdbcType=TIMESTAMP},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "del_status = #{delStatus,jdbcType=BIT},",
          "archive_status = #{archiveStatus,jdbcType=BIT},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "watch_function = #{watchFunction,jdbcType=INTEGER},",
          "watch_movement = #{watchMovement,jdbcType=INTEGER},",
          "case_material = #{caseMaterial,jdbcType=INTEGER},",
          "watch_exterior = #{watchExterior,jdbcType=INTEGER},",
          "repair_parts = #{repairParts,jdbcType=INTEGER},",
          "purchase_place = #{purchasePlace,jdbcType=VARCHAR},",
          "tablehandle_button = #{tablehandleButton,jdbcType=VARCHAR},",
          "is_insure = #{isInsure,jdbcType=BIT},",
          "entrusted_mail = #{entrustedMail,jdbcType=VARCHAR},",
          "watch_serie = #{watchSerie,jdbcType=VARCHAR},",
          "watch_model = #{watchModel,jdbcType=VARCHAR},",
          "purchase_time = #{purchaseTime,jdbcType=TIMESTAMP},",
          "is_repair = #{isRepair,jdbcType=BIT},",
          "customer_profile = #{customerProfile,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(SysOrder record);
}